package com.ruoyi.system.domain.HUAWEI;

import cn.hutool.core.date.DateUtil;
import com.ruoyi.system.domain.MES.KeymatBind;
import com.ruoyi.system.domain.MES.MaterialDatasDTO;
import com.ruoyi.system.domain.function.ProdOrder;
import lombok.Data;

/**
 * @description: 华为父子条码追溯实体类
 * @author: zhengxiong.jiang
 * @createDate: 2025-04-15
 * @version: 1.0
 */
@Data
public class BarcodeRelationSendDTO {

    private String orgId;
    private String itemCode;
    private String po;
    private String vendorId;
    private String barCode;
    private String quantity;
    private String supplier;
    private String sonBarCode;
    private String sonItemCode;
    private String manufactory;
    private String checkMessage;
    private String itemId;
    private String uploadFlag;
    private String sonItemId;
    private String checkFlag;
    private String emsTransId;
    private String checkInfo;
    private String createdBy;
    private String createdDate;
    private String updatedBy;
    private String updatedDate;
    private String segment9;
    private String segment10;
    private String segment11;
    private String segment12;
    private String segment13;
    private String segment14;
    private String segment15;
    private String segment8;
    private String segment1;
    private String segment2;
    private String segment3;
    private String segment4;
    private String segment5;
    private String segment6;
    private String segment7;

    public BarcodeRelationSendDTO() {

    }

    public BarcodeRelationSendDTO(MaterialDatasDTO dto, KeymatBind keymatBind,
                                  String H4,String mtlVendorName,ProdOrder prodOrder) {
        this.po = prodOrder.getTaskTon();
        this.vendorId = "22827731";
        this.orgId = "157";
        this.itemCode = keymatBind.getFProdCodeNo();
        this.barCode = keymatBind.getFNumber();
        this.sonBarCode = dto.getFMaterielBarcode();
        this.sonItemCode = dto.getFMaterielCode();
        this.quantity = "1";
        this.supplier = mtlVendorName;
        this.manufactory = "";
        this.uploadFlag = "0";
        this.checkMessage = "";
        this.createdBy = "LD001";
        this.createdDate = DateUtil.format(dto.getFDate(), "yyyy-MM-dd HH:mm:ss");
        this.updatedBy = "";
        this.updatedDate = "";
        this.segment1 = "N";
        this.segment2 = "N";
        this.segment3 = prodOrder.getTaskTon();
        this.segment4 = "";
        this.segment5 = "";
        this.segment6 = "";
        this.segment7 = "";
        this.itemId = "";
        this.sonItemId = "";
        this.checkFlag = "0";
        this.emsTransId = H4;
        this.checkInfo = "";
        this.segment8 = "";
        this.segment9 = "";
        this.segment10 = dto.getFMaterielCode();
        this.segment11 = keymatBind.getFProdCodeNo();
        this.segment12 = "";
        this.segment13 = "";
        this.segment14 = "40033";
        this.segment15 = "EMS";
    }


    public BarcodeRelationSendDTO(EmsBarcodeRelation emsBarcodeRelation) {
        this.po = emsBarcodeRelation.getPo();
        this.vendorId = "22827731";
        this.orgId = "157";
        this.itemCode = emsBarcodeRelation.getItemCode();
        this.barCode = emsBarcodeRelation.getBarCode();
        this.sonBarCode = emsBarcodeRelation.getSonBarCode();
        this.sonItemCode = emsBarcodeRelation.getSonItemCode();
        this.quantity = "1";
        this.supplier = emsBarcodeRelation.getSupplier();
        this.manufactory = "";
        this.uploadFlag = "0";
        this.checkMessage = "";
        this.createdBy = "LD001";
        this.createdDate = DateUtil.format(emsBarcodeRelation.getCreatedDate(),"yyyy-MM-dd HH:mm:ss");
        this.updatedBy = "";
        this.updatedDate = "";
        this.segment1 = "N";
        this.segment2 = "N";
        this.segment3 = emsBarcodeRelation.getSegment3();
        this.segment4 = "";
        this.segment5 = "";
        this.segment6 = "";
        this.segment7 = "";
        this.itemId = "";
        this.sonItemId = "";
        this.checkFlag = "0";
        this.emsTransId = emsBarcodeRelation.getEmsTransId();
        this.checkInfo = "";
        this.segment8 = "";
        this.segment9 = "";
        this.segment10 = emsBarcodeRelation.getSegment10();
        this.segment11 = emsBarcodeRelation.getSegment11();
        this.segment12 = "";
        this.segment13 = "";
        this.segment14 = "40033";
        this.segment15 = "EMS";
    }

}
